<?php
/**
 * Created by PhpStorm.
 * User: deng
 * Date: 2015/2/16
 * Time: 1:14
 */

namespace Common\Controller;

use MongoClient;

require_once('Application/Common/Model/DB.php'); //引入DB.php


/**
 * Class NormalApiController
 * @package Common\Controller
 * 普通Api类，此类的目的是为那些Serve方法提供一个api的基础类
 */
class NormalApiController extends ApiController
{

    protected $_db;

    public function __construct()
    {
        parent::__construct();
        global $db;
        if (!isset($db)) {
            $db = \DB::build('Application/Common/Model/models/', (new MongoClient())->metalab);
        }
        $this->_db = $db;

    }
}